Structures and pointers
Example 3: Using two structures
Factory database:
struct address {
char street[30];
int number;
};
struct person {
char name[30];
struct address addr;
float salary;
};
struct person factory[90];
int main(){
cout<< factory[who].addr.number
<< factory[who]. addr.street;
};
int i, who = 0;
float most = 0, aux;
for (i=0; i < 900; i++)
if ((aux = factory[i].salary)
>most){
most = aux;
who = i;
}